// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_BPT_APPLICATION_ATTACHED
// * CreateDate    : 2012/3/20 14:38:09
// * Creater       : CodeSmith
// * LastChangeDate: 2012/3/20 14:38:09
// * LastChanger   : 2012/3/20 14:38:09
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Suzsoft.Smart.Data;
using ESOL.Common.Entity;

namespace ESOL.Business.Bpt
{
/// <summary>
    /// BptApplicationAttached
    /// </summary>
    public partial class BptApplicationAttachedBs
    {
        #region GetByID
        /// <summary>
        /// Get Entity
        /// </summary>
        /// <param name="objBptApplicationAttachedEntity">Entity</param>
        /// <returns>Entity</returns>
        public static BptApplicationAttachedEntity GetBptApplicationAttached(BptApplicationAttachedEntity objBptApplicationAttachedEntity)
        {
            return DataAccess.SelectSingle<BptApplicationAttachedEntity>(objBptApplicationAttachedEntity);
        }

        public static DataTable GetFilesAppByID(string ApplicationID)
        {
            string sql = "select * from dbo.BPT_APPLICATION_ATTACHED where BPT_APPLICATION_ID='" + ApplicationID + "' order by FILE_TYPE";
            DataSet ds = new DataSet();
            ds = DataAccess.SelectDataSet(sql);
            if (ds != null && ds.Tables.Count > 0)
            {
                return ds.Tables[0];
            }
            return null;

        }
        #endregion


        #region Insert
        /// <summary>
        /// Insert Data
        /// </summary>
        /// <param name="objBptApplicationAttachedEntity">Entity</param>
        /// <returns>true Insert Succeed; false Insert Fail</returns>
        public static bool InsertBptApplicationAttached(BptApplicationAttachedEntity objBptApplicationAttachedEntity)
        {
            return DataAccess.Insert(objBptApplicationAttachedEntity);
        }

        public static bool InsertBptApplicationAttached(List<BptApplicationAttachedEntity> objBptApplicationAttachedEntityList)
        {
            return DataAccess.Insert(objBptApplicationAttachedEntityList);
        }
        #endregion


        #region Update
        /// <summary>
        /// Update Data
        /// </summary>
        /// <param name="objBptApplicationAttachedEntity">Entity</param>
        /// <returns>true Update Succeed; false Update Fail</returns>
        public static bool UpdateBptApplicationAttached(BptApplicationAttachedEntity objBptApplicationAttachedEntity)
        {
            return DataAccess.Update(objBptApplicationAttachedEntity);
        }

        public static bool UpdateBptApplicationAttached(List<BptApplicationAttachedEntity> objBptApplicationAttachedEntityList)
        {
            return DataAccess.Update<BptApplicationAttachedEntity>(objBptApplicationAttachedEntityList);
        }
        #endregion


        #region Delete
        /// <summary>
        /// Delete Data
        /// </summary>
        /// <param name="objBptApplicationAttachedEntity">Entity</param>
        /// <returns>true Delete Succeed; false Delete Fail</returns>
        public static bool DeleteBptApplicationAttached(BptApplicationAttachedEntity objBptApplicationAttachedEntity)
        {
            return DataAccess.Delete(objBptApplicationAttachedEntity);
        }

        public static bool DeleteBptApplicationAttached(List<BptApplicationAttachedEntity> objBptApplicationAttachedEntityList)
        {
            return DataAccess.Delete<BptApplicationAttachedEntity>(objBptApplicationAttachedEntityList);
        }
        #endregion


        #region GetAll
        /// <summary>
        /// Get All Data
        /// </summary>
        /// <returns>Back All Data<returns>
        public static DataSet GetBptApplicationAttachedAll()
        {
            return DataAccess.SelectAllDataSet<BptApplicationAttachedEntity>();
        }
        /// <summary>
        /// Get All Data List
        /// </summary>
        /// <returns>Back All Data List<returns>
        public static List<BptApplicationAttachedEntity> GetBptApplicationAttachedAllList()
        {
            return DataAccess.SelectAll<BptApplicationAttachedEntity>();
        }
        #endregion
	}
	
	
}	

